

import orm
import asyncio
from pmodel import User, Blog, Comment

async def test(loop):                      # *** 注意此处的密码填自己设的密码 ***
    await orm.create_pool(loop=loop, user='root', password='root', db='awesome')
    # await orm.create_pool(user='root', password='root', db='awesome')
                                           # *** 注意此处的密码填自己设的密码 ***
    u = User(name='Test3', email='test3@qq.com', passwd='1234567890', image='about:blank')
    await u.save()
    orm.__pool.close()
    await orm.__pool.wait_closed()


if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(test(loop))
    loop.close()
